import store from "@/store";

export const itemStyle = {
  marginBottom: 0,
  padding: "10px 40px",
};

// 表单配置项
export const formBase = [
  {
    type: "daterange",
    field: "shelfTime",
    label: "交单日期",
    otherOptions: {
      type: "datetimerange",
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              console.log("start.getTime()", start.getTime());
              console.log("日期", this.riqi);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      valueFormat: "yyyy-MM-dd HH:mm:ss",
    },
  },
  {
    type: "select",
    field: "companyId",
    label: "快递公司",
    optionsKey: "companyName",
    optionsValue: "id",
    options: store.state.custom_dict.company,
    otherOptions: {
      disabled: false,
      clearable: true,
    },
  },
];

// 表格配置项
export const tableBase = [
  {
    label: "快递公司",
    prop: "companyName",
  },
  {
    label: "仓库ID",
    prop: "warehouseId",
    width: 140,
  },
  {
    label: "仓库",
    prop: "warehouseName",
    width: 140,
  },
  {
    label: "交单数",
    prop: "documentSubmittedNum",
    width: 200,
  },
  {
    label: "垫付款",
    prop: "advancePayment",
    width: 140,
  },
  {
    label: "到库数",
    prop: "arrivalNum",
    width: 140,
  },
  {
    label: "Qc数量",
    prop: "qcQuantity",
    width: 140,
  },
];

/* 

           "id": 209,
            "companyId": null,
            "companyName": "顺丰",
            "warehouseName": "深圳佰茂直通云仓",
            "advancePayment": 0.00,
            "courierNumber": "SF888",
            "createTime": "2024-03-15 14:04:06",
            "upStatus": 1,
            "shelfTime": "2024-03-15 14:23:39",
            "entryStatus": 1
*/
// 表格配置项
export const tableBase2 = [
  {
    label: "快递公司",
    prop: "companyName",
    width: 300,
  },
  {
    label: "快递单号",
    prop: "courierNumber",
    width: 140,
  },
  {
    label: "垫付款",
    prop: "advancePayment",
    width: 200,
  },
  {
    label: "交单时间",
    prop: "createTime",
    width: 200,
  },
  {
    label: "仓库",
    prop: "warehouseName",
    width: 140,
  },
  {
    label: "已入库",
    slotName: "entryStatus",
    prop: "entryStatus",
    width: 140,
  },
  {
    label: "上架",
    prop: "upStatus",
    width: 140,
    slotName: "upStatus",
  },
  {
    label: "上架时间",
    prop: "shelfTime",
    width: 200,
  },
];
